package com.molichuxing.services.infrastructure.convertor;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.BeanUtils;

import com.molichuxing.services.infrastructure.bean.BlacklistBean;
import com.molichuxing.services.infrastructure.dto.response.BlacklistDto;

/**
 * 
 * @author liyg 数据转换类 2019-08-15
 * 
 */
public class Convert {

	public static List<BlacklistDto> toBlacklistDto(List<BlacklistBean> beanList){
		List<BlacklistDto> dtoList = null;;
		if (beanList != null && beanList.size() > 0) {
			dtoList = new ArrayList<>();
			for (BlacklistBean blacklistBean : beanList) {
				dtoList.add(toBlacklistDto(blacklistBean));
			}
		}
		
		return dtoList;
	}
	
	public static BlacklistDto toBlacklistDto(BlacklistBean bean) {
		BlacklistDto beanDto = null;
		if (bean != null) {
			beanDto = new BlacklistDto();
			BeanUtils.copyProperties(bean, beanDto);
			beanDto.setBlacklistId(bean.getId());
		}
		return beanDto;
	}
   
}
